|
NET MESSAGE TYPE
This command returns the type of the current message in the queue.
Return Integer=NET MESSAGE TYPE()
This command returns the type of the current message in the queue. The type can be one of four values. If the type is 1, the message is an integer value. If the type is 2, the message is a float value. If the type is 3, the message is a string. If the type is a 4, then the message is a memblock. If the type is a 5, the message is an image. If the type is a 6, the message is a bitmap. If the type is a 7, the message is a sound. If the type is an 8, the message is a mesh
The type can be one of four values. If the type is 1, the message is an integer value. If the type is 2, the message is a float value. If the type is 3, the message is a string. If the type is a 4, then the message is a memblock. If the type is a 5, the message is an image. If the type is a 6, the message is a bitmap. If the type is a 7, the message is a sound. If the type is an 8, the message is a mesh. You must check the type of a message before you can read it correctly using one of the appropriate NET MESSAGE commands.
rem Network game can communicate numbers and strings
while inkey$()<>"x"
cls
print "HANDLE NET MESSAGES (Press X To Continue)"
rem Show Latest Return Values
print
print "STRING: ";ReturnString$
print
rem Send Part
if mouseclick()=1
print "SENDING..."
send net message string 0,"hello world"
endif
rem Receive Part (from all other players)
get net message
if net message exists()=1 then print "RECEIVING..."
while net message exists()=1
if net message type()=3 then ReturnString$=net message string$()
get net message
endwhile
endwhile
MULTIPLAYER Commands Menu
Index
|